import {defHttp} from '/@/utils/http/axios';
import {Modal} from 'ant-design-vue';

export const listConfigType = () => {
  return defHttp.get({url: '/infra-service/configTmpl/listType', params: {}});
}

export const getCopyTmpl = (params) => {
  return defHttp.get({ url: '/infra-service/configTmpl/copy', params });
}

export const importTmpl = (params) => {
  return defHttp.post({ url: '/infra-service/configTmpl/import', params });
}


export const getTmpl = (params) => {
  return defHttp.get({url: '/infra-service/configTmpl/get', params});
}

export const listTmpl = (params) => {
  return defHttp.get({url: '/infra-service/configTmpl/list', params});
}

export const saveOrUpdateTmpl = (params, isUpdate) => {
  let url = '/infra-service/configTmpl/' + (isUpdate ? 'update' : 'save');
  return defHttp.post({url: url, params});
}

export const deleteTmpl = (params, handleSuccess) => {
  return defHttp.delete({url: '/infra-service/configTmpl/delete', data: params}, {joinParamsToUrl: true}).then(() => {
    handleSuccess();
  });
}
